Process supervision is to be implemented in order for the supervisor process to monitor the activity of the processes, such as controlled or uncontrolled termination, and in the case of uncontrolled termination the supervisor should restart the process. We chose to notify the supervisor of the termination status of a process by passing a parameter with the quitter() or tuer() system calls. 

The PCB contains a "supervisors" field, which is an array of pointers to supervisors PCB, so that whenever the exit command is executed, its parameter (to be defined) is passed to the supervisors found in the array.

The following function allows a process to register as a supervisor of a set of another processes:
\begin{itemize}

	\item int register\_supervisor(supervisor, supervised[]):

By using the function register\_supervisor, the process having the pid \textit{supervisor} registers itself as a supervisor of the processes whose pid is in the \textit{supervised} array. What the register\_supervisor function does is that it retrieves the pointer to the supervisor's PCB and copies it to the supervisors array of the processes being supervised. 
\end{itemize}

\subsection*{Notifying the supervisor}
The supervisor is notified if one of the supervised processes terminates, either in a controlled or uncontrolled way. The notifications are sent using message passing. Messages generated to notify supervisors will have a given high priority. The data of the message is the parameter given to quitter(). The parameter passed will reflect the state of the termination and even the cause of it. 

This module needs the message\_passing module (section \ref{message_passing}). 
